package com.sy.service.impl;

import com.sy.dao.PriceDao;
import com.sy.dao.impl.PriceDaoImpl;
import com.sy.entity.Price;
import com.sy.service.PriceService;

import java.util.ArrayList;
import java.util.List;

import static com.sy.constant.BusinessConstant.ALL_PRICE_RANGE_ID;

public class PriceServiceImpl extends AbstractBaseServiceImpl implements PriceService {
    private PriceDao priceDao = new PriceDaoImpl();

    @Override
    public List<Price> getAllPriceRanges() {
        List<Price> prices = new ArrayList<>();
        Price allPrice = new Price();
        allPrice.setId(ALL_PRICE_RANGE_ID);
        allPrice.setDesc("全部");
        prices.add(allPrice);
        prices.addAll(priceDao.getAllPriceRanges());
        return prices;
    }
}
